package com.hui.security.sys.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * <b><code>HttpPoolConfig</code></b>
 * <p/>
 * Description:
 * <p/>
 * <b>Creation Time:</b> 2019/1/16 16:10.
 *
 * @author Hu weihui
 */
@Component
@ConfigurationProperties(prefix = "http")
@Data
public class HttpPoolConfig {
    /**
     * 设置整个连接池最大连接数 根据自己的场景决定
     */
    private Integer maxTotal;
    /**
     * 路由是对maxTotal的细分
     */
    private Integer defaultMaxPerRoute;
    /**
     * 连接上服务器(握手成功)的时间，超出该时间抛出connect timeout
     */
    private Integer connectTimeout;
    /**
     * 从连接池中获取连接的超时时间，超过该时间未拿到可用连接，会抛出org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
     */
    private Integer connectionRequestTimeout;
    /**
     * 服务器返回数据(response)的时间，超过该时间抛出read timeout
     */
    private Integer socketTimeout;
    /**
     * The Validate after inactivity.
     */
    private Integer validateAfterInactivity;
}
